package per.qiao.simplechian.samples.spring;

import per.qiao.simplechian.bo.NodeParam;
import per.qiao.simplechian.bo.NodeResult;
import per.qiao.simplechian.core.DefaultNode;
import per.qiao.simplechian.core.NodeGroup;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import per.qiao.simplechian.samples.beans.MyBean;

/**
 * @author: qiaoyp
 * @Date: 2024/8/21 21:55
 * @Description:
 */
@Component
@NodeGroup(value = {"testGroup", "group2"})
public class FirstNode extends DefaultNode {

    @Autowired
    private MyBean myBean;

    @Override
    protected NodeResult doExec(NodeParam param, NodeResult preRtn) {
        Integer num = (Integer) preRtn.getResult();
        num += 10;
        preRtn.setResult(num);
        myBean.say();
        return preRtn;
    }



    @Override
    public int getOrderNum() {
        return 1;
    }
}
